using System;

namespace GeoFramework.IO.Bluetooth
{
	/// <summary>
	/// This structure contains additional parameters for device inquiries.
	/// </summary>
	internal class BTHNS_INQUIRYBLOB : BTHNS_BLOB
	{

		public BTHNS_INQUIRYBLOB(short length, short responses)
		{
			m_data = new byte[8];

            Lap = 0x9e8b33;
            Length = length;
            Responses = responses;
		}

        ///<summary>
        ///LAP from which the inquiry access code is derived when the inquiry procedure is made.
        ///</summary>
        public uint Lap
        {
            get
            {
                return BitConverter.ToUInt32(m_data,0);
            }
            set
            {
                BitConverter.GetBytes(value).CopyTo(m_data, 0);
            }
        }

         ///<summary>
         ///Amount of time allowed to perform the query.
         ///This value is measured in units of 1.28 seconds (time to query=length*1.28 seconds).
         ///The default value is 16.
         ///</summary>
        public new short Length
        {
            get
            {
                return BitConverter.ToInt16(m_data,4);
            }
            set
            {
                BitConverter.GetBytes(value).CopyTo(m_data, 4);
            }
        }

         ///<summary>
         ///Maximum number of devices to retrieve information about before stopping the inquiry. The default value is 16.
         ///</summary>
        public short Responses
        {
            get
            {
                return BitConverter.ToInt16(m_data,6);
            }
            set
            {
                BitConverter.GetBytes(value).CopyTo(m_data, 6);
            }
        }


		
	}
}
